﻿<?php
require('conn.php');
require('functions.php');
require('session.php');
//print_r($userdata);
// if($userdata['phone']==''){
	// echo "<script>alert('请填写手机号码用于登录帐号');location.href='zl.php'</script>";
	// exit;	
// }
?>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>个人中心 - <?php echo $config['sitename']?></title>
<meta name="keywords" content="<?php echo $config['sitename']?>,个人中心,用户中心" />
<meta name="description" content="<?php echo $config['sitename']?>个人中心。">
<meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="format-detection" content="telephone=no" />
<link href="Css1/header.css" rel="stylesheet" type="text/css" />
<link href="Css1/home.css" rel="stylesheet" type="text/css" />
<script type=text/javascript > var app="/user" </script>
<script type="text/javascript" src="Scripts1/jquery.min.js"></script>
<script type=text/javascript src="Scripts1/jquery.common.js"></script>
</head>

<body class="mhome">

<!--
<header>
	<div class="logo"></div>
</header>
-->
<div id="content">
<?php include('header.php');?>
<script>
	(function () {
		var menustate = document.getElementById('g-menustate');
		menustate.addEventListener("click", function (e) {
			if (menustate.checked) {
				$('#g-menustate').addClass('g-noscroll')
			}else {
				$('#g-menustate').removeClass('g-noscroll')
			}
		});
	})();
</script>
		<style>
			body {
				background-color: #f4f4f4;
			}
			.empty {
				text-align: center;
				padding: 120px 0;
			}
			.link {
				position: absolute;
				padding-top: 12px;
				margin-left: 150px;
				color: #bfbfbf;
				display: initial;
			}
.g-menuicon-label {
    font-size: 1rem;
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 48px;
    line-height: 48px;
    z-index: 20;
    cursor: pointer;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}
		</style>
		<div class="wrap">
			<div class="indpart1 bgfff">
				<div class="username">
				<span class="Myinfo" onClick="openinfo();">个人设置></span>
				<img src=""  onerror="javascript:this.src='avatar/1/original.jpg';" id="myavatar"><i id="mynicename">您好<?php echo $userdata['id']?></i>
				</div>
				
				<div class="cont" onClick="openShowUSER();">
					<b>
					<div class="money" id="mymoney">
						<?php echo $userdata['money']?>					</div></b>
					<span><img src="Picture1/pig.png">可用余额 (分享币)</span>
				</div>
				<ul class="clearfix">
					<li>
						<a   href="listrw.php?uid=<?php echo $session['id']?>" ><img src="Picture1/indico1.png"><i>开始赚钱</i></a>
					</li>
					<li>
						<a  href="dingdan.php"><img src="Picture1/indico2.png"><i>我的订单</i></a>
					</li>
					<li>
						<a href="jifenlist.php"><img src="Picture1/indico3.png"><i>积分兑换</i></a>
					</li>
				</ul>
			</div>
<section class="noitce " id="noitce" >
<div class="recharge_post clearfix" id="divdown1" style="display: block;"><p><span class="notice-msg"><?php echo $config['gonggao']?>
</span><span id="close-notice" class="close-notice">X</span></p>
</div>
</section>
			<div class="indpart2 bgfff clearfix">
				<dl class="clearfix fl"  onclick="openShowUmoney();">
					<span class="link">&gt;</span>
					<dt><img src="Picture1/userpic1.png">
					</dt>
					<dd>
						<i>个人收入</i>
					</dd>
					<dd>
						<ins id="myumoney"><?php echo $userdata['money']?></ins>
					</dd>
				</dl>
				<dl class="clearfix fr" onClick="openShowImoney();">
					<span class="link">&gt;</span>
					<dt><img src="Picture1/userpic2.png">
					</dt>
					<dd>
						<i>提成收入</i>
					</dd>
					<dd>
                    
                    <?php
					
					$row=$mysql->query("select SUM(money) as prod_sum from `userdata` where `tj_id`='{$session['id']}'");
					?>
						<ins id="myimoney"><?php echo  $row[0]['prod_sum'] ;  ?></ins>
					</dd>
				</dl>
			</div>
			<div class="indpart3 bgfff">
				<ul class="clearfix">
                
                
                		<li>
						<a onClick="openzhuanhuan();"><img src="Picture1/indpic2.png"><i>每日领钱</i></a>
					</li>
                    
                    
				
					<li>
						<a onClick="opentask();"><img src="Picture1/indpic6.png"><i>我要收徒</i></a>
					</li>
					<li>
						<a href="xia.php"><img src="Picture1/indpic3.png"><i>好友列表</i></a>
					</li>
					<li>
						<a  href="pai.php"><img src="Picture1/indpic4.png"><i>收入排行</i></a>
					</li>
				<li>
						<a href="news.php"><img src="Picture1/indpic1.png"><i>新手帮助</i></a>
					</li>
			 	<li>
						<a onClick="openmycontent();"><img src="Picture1/indpic5.png"><i>我的任务</i></a>
					</li> 
					<li>
						<a   onclick="openShowcashlist();"><img src="Picture1/indpic7.png"><i>我要提现</i></a>
					</li>

					<li>
						<a href="lianxi.php"><img src="Picture1/indpic8.png"><i>在线客服</i></a>
					</li>
				</ul>
							<a href="session.php?do=exit" class="g-btn g-btn-medium-major">退出登录</a>
			</div>
		</div> 
		</div>
	</body>
	<script>
		var userid = '311303';
		var username = '13063041684';
		var timeout = true;
		 $(function () {
		var menustate = document.getElementById('close-notice');
		menustate.addEventListener("click", function (e) {
				$('#noitce').hide();
		});
			get_info(); 
			ref = setInterval("get_info()", 15000);
		});
		function openShowUSER() {
			 window.location.href="/referer.php"; 
		}
		function openinfo() {
			 window.location.href="/zl.php"; 
		}
		function set_time(timenum) {
			if (timeout)
				return;
			get_info();
			setTimeout(time, timenum);
			//time是指本身,延时递归调用自己,100为间隔调用时间,单位毫秒
		}

		function set_time_status() {
			get_info();
			timeout = true;
			set_time(5000);
		}
		function openduiba() {
			window.location.href="/user/api/duiba_login"; 
		}
		function to_share() {
			 window.location.href="/index/hot/?uid=311303"; 
		}

		function openShowcashlist() {
			window.location.href="/tx.php"; 
		}

		function openzhuanhuan() {
			window.location.href="list.php?uid=<?php echo $session['id']?>"; 
		}

		function openmycontent() {
			window.location.href="/mylist.php"; 
		}

		function openCouponsWin() {
			window.location.href="/user/pay/coupons"; 
		}

		function openShowcashways() {
			window.location.href="/user/pay/"; 
		}

		function openHelp() {
			window.location.href="/school/"; 
		}

		function openfriends() {
			window.location.href="/user/friends"; 
		}
		function openinvite() {
			window.location.href="/user/friends/invite.html"; 
		}
		function opentask() {
			window.location.href="apprent.php"; 
		}

		function openRank() {
			window.location.href="/user/home/rank.html"; 
		}

		function openmessage() {
			window.location.href='https://eco-api.meiqia.com/dist/standalone.html?eid=6940&groupid=375b0ae2bd93785782d43a96ff1f7b52&&metadata={"comment":"'+userid+'","tel":"'+username+'"}'; 
		}

		function openShowImoney() {
			window.location.href="/xia.php"; 
		}

		function openShowUmoney() {
			window.location.href="/referer.php"; 
		}
		function get_info() {
          $.ajax({
            type: 'get',
            url: "/user/api/get_user_info",
            dataType: "json",
            cache: false,
            success: function(ret) {
              if (ret.status == 1) {
					document.getElementById('mymoney').innerHTML = ret.money;
					document.getElementById('myumoney').innerHTML = ret.umoney;
					document.getElementById('myimoney').innerHTML = ret.imoney;
					document.getElementById('mynicename').innerHTML = '您好，' + ret.nicename;
					//document.getElementById('myavatar').src = ret.avatar;
              } else {
                alert('系统错误，请重新登录！');
              }
            }
          });
		}
	</script>

<style>
.act-dialog_mask{position:absolute;top:0;right:0;bottom:0;left:0;z-index:96;width:100%;height:100%;background-color:rgba(0,0,0,.3)}.act-dialog_mod{position:fixed;top:0;right:0;bottom:0;left:0;z-index:100;width:100%;height:100%;display:-webkit-box;display:-ms-flexbox;-webkit-box-orient:vertical;-webkit-box-pack:center;-webkit-box-align:center;-ms-flex-direction:column;-ms-flex-pack:center;-ms-flex-align:center}.act-dialog{position:relative;z-index:99;width:280px;margin:8px 0;background-color:#fff;border-radius:5px}.act-dialog_bd{padding:10px}.act-dialog_ft{border-top:1px solid #d5d5d6;display:-webkit-box;display:-ms-flexbox;display:box}.act-dialog_btn__confirm,.act-dialog_btn__cancel{display:block;width:100%;height:50px;border:none;font-size:18px;text-align:center;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;-webkit-box-flex:1;-ms-flex:1;box-flex:1}.act-dialog_btn__confirm{background:#fff;color:#02bb00}.act-dialog_btn__confirm:active{background:#f9f9f9}.act-dialog_btn__cancel{background:#fff;color:#353535}.act-dialog_btn__cancel:active{background:#f9f9f9}.act-dialog_ft button:first-child{border-right:1px solid #d5d5d6;border-radius:0 0 0 5px}.act-dialog_ft button:last-child{border-radius:0 0 5px}.act-dialog_ft button:only-child{border-radius:0 0 5px 5px;border-right:none}.act-dialog_fail{min-height:72px;text-align:center;display:-webkit-box;-webkit-box-orient:vertical;-webkit-box-pack:center;-webkit-box-align:center}.act-dialog_fail__t{color:#000;font-size:16px}.act-dialog_fail__d{padding-top:5px;color:#888;font-size:16px}.act-dialog_suc{padding:15px 5px 5px;overflow:hidden}.act-dialog_suc__view{float:left}.act-dialog_suc__img{display:block;width:75px;height:75px;-webkit-animation:tada 1s .2s ease 3 both}.act-dialog_suc__info{padding:0 0 0 10px;overflow:hidden}.act-dialog_suc__t{color:#000;font-size:18px}.act-dialog_suc__d{color:#353535;font-size:14px}.act-dialog_tips{clear:both;padding-top:15px;font-size:12px;text-align:center;color:#888}
</style>

<script type="text/javascript">
	function closemsg(){
				$("#masks").hide();
				$("#copyurl").hide();
				
	}
	function showmsg(){
				$("#masks").show();
				$("#copyurl").show();
				
	}
	function look(){ 
				$("#masks").hide();
				$("#copyurl").hide();
				window.location.href ="http://jq.qq.com/?_wv=1027&k=2JGq6T0"; 
	}
	</script>
<div style="display: none;">
</div>
</div>

 
</body>
</html>